package com.feishi.core.analytic.parser;

import java.util.List;

/**
 * Created by caixq on 5/4 004.
 */
public interface PoParser<T> {
    byte[] getBytes(T value);

    T getValue(byte[] bytes);


    List<Filter<T>> getFilters();

    default void addFilter(Filter<T> filter){
        getFilters().add(filter);
    }
    default T doFilter(T t){
        for (Filter<T> filter :getFilters() ) {
            t=filter.doFilter(t);
        }
        return t;
    }
}
